package com.vayne.producer;

import com.vayne.common.AbstractProducer;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;

import java.util.Properties;

/**
 * {@link java.nio.MappedByteBuffer}
 * log.index.size.max.bytes : default size is 10M
 */
public class rLogIndexSizeMaxBytesProduceDemo extends AbstractProducer {

    // version v0 message test
    private static final String TOPIC = "ms_format_v2";

    public static void main(String[] args) {
        Properties properties = initConfig(null);
        KafkaProducer<String, String> producer = new KafkaProducer<>(properties);
        for (int i = 0; i < Integer.MAX_VALUE; i++) {
            producer.send(new ProducerRecord<>(TOPIC, "Message Order 【"+ i +"】"));
        }
        producer.close();
    }
}
